package com.erb.controller.common;

import com.erb.service.llb.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 前台公用控制器
 */
@Controller
@RequestMapping
public class PublicController {
	@Autowired
	IndexService indexService;

	@GetMapping("/")
	public String index(Model model) {
		model.addAttribute("advertisements", indexService.findAdvertisement(true));
		return "common/index";
	}

	@GetMapping("/login")
	public String login() {
		return "common/login";
	}

	@GetMapping("/register")
	public String register() {
		return "common/register";
	}
}
